package com.yyi.springcloud.service.impl;


import com.yyi.springcloud.dao.ConnInfoMapper;
import com.yyi.springcloud.entities.ConnInfoModel;
import com.yyi.springcloud.service.Local_ConnInfoService;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import javax.annotation.Resource;
import java.util.List;

@Service
public class Local_ConnInfoServiceImpl implements Local_ConnInfoService {
    @Resource
    private ConnInfoMapper connInfoMapper;

    public ConnInfoMapper getConnInfoMapper() {
        return connInfoMapper;
    }

    public void setConnInfoMapper(ConnInfoMapper connInfoMapper) {
        this.connInfoMapper = connInfoMapper;
    }

    //1.根据实验室编码查看webservice的连接信息
    @Override
    public List<ConnInfoModel> getConnInfoByLabCode(String labCode) {
        Example example = new Example(ConnInfoModel.class);
        example.createCriteria().equals(labCode);
        return connInfoMapper.selectByExample(example);
    }

    //2.查询所有的连接信息
    @Override
    public List<ConnInfoModel> getAllConnInfo() {
        return connInfoMapper.select(null);
    }
}

